﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Controls;
using System.Globalization;

namespace AgilePlannerDT.Display.ValidationRules
{
    public class DateTimeValuesOnlyRule : ValidationRule
    {
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            DateTime dt;
            if (!DateTime.TryParse((string)value, out dt))
            {
                return new ValidationResult(false, "Invalid date format");
            }

            return ValidationResult.ValidResult;
        }
    }
}
